<?php

class Login_model extends CI_Model {

    public function __construct() {
        $this->load->database();
    }

    public function login_proses($data, $username) {
        $this->db->insert("audit_trail", $data);

        $sql = "SELECT id_user, password, nik, id_group_user, is_active FROM mt_user WHERE id_user='" . $username . "' ";
        $true = $this->db->query($sql);
        //echo $this->db->last_query();
        return $true;
    }

    public function getNIK($nik) {
        $sql = "SELECT k.nama, k.nik FROM mt_karyawan k WHERE k.nik='" . $nik . "' ";
        
        $nik_rs = $this->db->query($sql);
        return $nik_rs;
    }

}

?>
